package Test;
//20230404430920沈泽华
import java.util.ArrayList;

public class Main {
    public static void main(String[] args) {
        ArrayList<Student> list = new ArrayList<>();

        list.add(new Student(1,"小亮",99));
        list.add(new Student(2,"小强",85));
        list.add(new Student(3,"小响",90));
        list.add(new Student(4,"小勇",75));

        int score = list.getFirst().getScore();//第一个学生的成绩

        int index = 0;//最低成绩学生的索引

        for(Student s:list)
        {
            int temple = s.getScore();
            if(temple < score){
                score = temple;
                index = list.indexOf(s);
            }
        }

        list.remove(index);
        System.out.println(list);

    }
}